<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>我的订单</title>
    <link rel="stylesheet" type="text/css" href="__CSS__api.css" />
    <link rel="stylesheet" type="text/css" href="__CSS__aui.css" />
    <link rel="stylesheet" type="text/css" href="__CSS__aui-slide.css" />
    <link rel="stylesheet" type="text/css" href="__CSS__dropload.css" />
    <style>
        .aui-bar-nav .aui-iconfont {
            position: relative;
            font-family: "aui_iconfont" !important;
            font-size: 0.75rem;
            color: #E73C5C;
            font-style: normal;
            -webkit-font-smoothing: antialiased;
            -moz-osx-font-smoothing: grayscale;
            height: 2.4rem;
        }

        .aui-bar-nav {
            background-color: #fff;
        }

        .aui-icon-tu {
            height: 2.4rem;
            width: 49px;
            background: url('__IMG__left.png') no-repeat 0.5rem center;
            background-size: 22px 22px;
        }

        .aui-bar-nav .aui-pull-right {
            padding-right: 0.75rem;
        }

        .aui-bar-nav .aui-title {
            font-size: 0.9rem;
            color: #333333;
            font-weight: 500;
        }

        body{
            background:#f5f5f5;
            padding-top: 0.5rem;
        }

        .content{
            width:100%;
            background:#fff;
            padding:0 0.75rem;
        }
        .container{
            padding:0.75rem 0;
        }
        .orderImg{
            width:5.9rem;
            height:4.1rem;
            margin-right:0.75rem;
            border-radius:0.25rem;
        }
        .orderContent{
            height:4.1rem;
            position:relative;
        }
        .title{
            font-size:0.71rem;
            color:#333;
        }
        .orderData{
            position: absolute;
            bottom:0;
            font-size:0.7rem;
            color:#999;
            line-height:0.7rem;
        }
        .orderTime{
            font-size:0.7rem;
            color:#999;
            text-align:left;
        }
        .status{
            /*width:2.5rem;*/
            padding:0.1rem 0.6rem;
            border:1px solid #ccc;
            border-radius:0.3rem;
            text-align:center;
            font-size:1.2rem;
            color:#B3B1B1;
            transform-origin: bottom right;
            -webkit-transform-origin: bottom right;
            transform:scale(0.5);
            -webkit-transform: scale(0.5);
            position:absolute;
            right:0;
            bottom:0
        }
        .foot{
            width:100%;
            font-size:0.75rem;
            color:#CCCACA;
            text-align:center;
            margin-top:1rem;
        }
    </style>
</head>

<body>
<header class="aui-bar aui-bar-nav underLine" style="padding-top:25px;" id="header">
    <a class="aui-pull-left" tapmode="active" onclick="history.go(-1)"> <span class="aui-iconfont aui-icon-tu"> </span> </a>
    <div class="aui-title">我的订单</div>
</header>
<div class="activity">
    <div class="upOrDown">
        <div class="upOrDown_data">
                <div class="content">
                    <!--<div class="container underLine2 flex-wrap" onclick="fnDetails('id')" tapmode='active'>-->
                        <!--<img src="__IMG__jingtaitu/doctor.png" alt="" class="orderImg">-->
                        <!--<div class="orderContent flex-con">-->
                            <!--<div class="title aui-ellipsis-1">文章标题一共只有一行显示....</div>-->
                            <!--<div class="orderData">2018-12-14</div>-->
                            <!--<div class="status">已完成</div>-->
                        <!--</div>-->
                    <!--</div>-->
                    <!--<div class="container underLine2 flex-wrap" onclick="fnDetails('id')">-->
                        <!--<img src="__IMG__jingtaitu/doctor.png" alt="" class="orderImg">-->
                        <!--<div class="orderContent flex-con">-->
                            <!--<div class="title aui-ellipsis-1">文章标题一共只有一行显示....</div>-->
                            <!--<div class="orderData">2018-12-14</div>-->
                            <!--<div class="status">已完成</div>-->
                        <!--</div>-->
                    <!--</div>-->

                </div>
        </div>
    </div>
</div>
<!--<div class="foot">没有更多了</div>-->

</body>
<script type="text/javascript" src="__JS__api.js"></script>
<script type="text/javascript" src="__JS__tt.js"></script>
<script type="text/javascript" src="__JS__doT.min.js"></script>
<script type="text/javascript" src="__JS__jquery.min.js"></script>
<script type="text/javascript" src="__JS__dropload.min.js"></script>
<script type="text/javascript">
    function fnDetails(id) {
        location.href = '{:url("my/myorder_detail")}?id='+id;
    }
</script>
<script>
    var page = 0;
    /**
     * 上拉加载，下拉刷新
     */
    var dropload = $('.upOrDown').dropload({
        scrollArea : window,
        autoLoad : true,
       // domUp : {
       //     domClass   : 'dropload-up',
       //     domRefresh : '<div class="dropload-refresh">↓下拉刷新-自定义内容</div>',
       //     domUpdate  : '<div class="dropload-update">↑释放更新-自定义内容</div>',
       //     domLoad    : '<div class="dropload-load"><span class="loading"></span>加载中-自定义内容...</div>'
       // },
       // domDown : {
       //     domClass   : 'dropload-down',
       //     domRefresh : '<div class="dropload-refresh">刷新</div>',
       //     domLoad    : '<div class="dropload-load"><span class="loading"></span>加载中...</div>',
       //     domNoData  : '<div class="dropload-noData">无数据</div>'
       // },
        loadDownFn : function(me){

            page++;
            console.log('page='+page);
            console.log('{:url("My/myOrderList")}');
            $.ajax({
                url:'{:url("My/myOrderList")}',
                data:'page='+page,
                type:'POST',
                dataType:'JSON',
                success: function(data){
                    var arrLen = data.msg.length;
                    if(arrLen<=0){

                        me.lock();
//                         无数据
                        me.noData(true);
                        // 每次数据加载完，必须重置
                        me.resetload();
                    }else{
                        datatolist(data.msg);
//                        $('.upOrDown_data').append(data);
                        // 每次数据加载完，必须重置
                        me.resetload();
                    }

                },
                error: function(xhr, type){
                    // 即使加载出错，也得重置
                    me.resetload();
                }
            });
        },
        loadUpFn : function(me){
            page = 1;
            $.ajax({
                url:'{:url("My/myOrderList")}',
                data:'page='+page,
                type:'POST',
                dataType:'json',
                success: function(data){
                    $('.content').empty();//
                    var datas = data.msg;
                    datatolist(datas);
                    me.resetload();
                    me.unlock();
                    me.noData(false);
                    // $('.cooc').click(function () {
                    //     var id = $(this).attr('id');
                    //     location.href = '{:url("First/activitydatail")}?activity_id='+id;
                    // });
                },
                error: function(xhr, type){
                    me.resetload();
                }
            });
        }
    });
    // getdata();
    function getdata() {
        $.ajax({
            url:'{:url("My/myOrderList")}',
            data:'page='+page,//
            type:'POST',
            dataType:'JSON',
            success: function(data){
                console.log(data);
                return ;
                if (data.length>0) {
                    // datatolist(data);
                }else {

                }
            },
            error: function(xhr, type){
                alert('Ajax error!');
                // 即使加载出错，也得重置

            }
        });

    }

    // 数据列表化
    function datatolist(data) {
        var html='';
        for (var i=0;i<data.length;i++) {
            html+='<div class="container underLine2 flex-wrap" onclick="fnDetails('+data[i].order_id+')">';
            if (data[i].classroom_img==''||data[i].classroom_img==null) {
                html+='<img src="__IMG__zhanweitu/active_list.png" alt="" class="orderImg">';
            }else {
                html+='<img src="'+data[i].classroom_img+'" alt="" class="orderImg">';

            }
            html+='<div class="orderContent flex-con">';
            html+='<div class="title aui-ellipsis-1">'+data[i].classroom_title+'</div>';
            html+='<div class="orderData">'+data[i].pay_time+'</div>';
            html+='<div class="status">已完成</div>';
            html+='</div>';
            html+='</div>';
        }
        $(".content").append(html);

    }
    // 打开某条列表详情
    function fnDetails(id) {
        
        location.href='{:url("my/myorder_detail")}?id='+id;


    }
</script>

</html>
